import React from 'react';
import { Select } from 'antd';
import classNames from 'classnames';

import BizIcon from '@/components/BizIcon';

import { SIGN_LIST } from './constant';
import signStyle from './index.less';
/**
 * 符号下接行择框
 * @returns {JSX.Element}
 */
const SignSelect = React.forwardRef(({ value, onChange, className, style, ...otherProps }, ref) => (
    <Select
        value={value}
        onChange={onChange}
        {...otherProps}
        suffixIcon={<BizIcon type="unfold_arrow_o" />}
        className={classNames(signStyle.sign, className)}
        style={style}
        ref={ref}
    >
        {SIGN_LIST.map(sign => (
            <Select.Option key={sign.value} value={sign.value}>
                {sign.text}
            </Select.Option>
        ))}
    </Select>
));

SignSelect.defaultProps = {
    style: { width: 44 }
};

export default SignSelect;
